package com.zmn.oms.business.interfaces.part;

import com.zmn.oms.common.exception.OmsBaseException;
import com.zmn.oms.model.dto.part.AddOrderPartDTO;
import com.zmn.oms.model.dto.part.CheckOrderPartIndicatorsDTO;
import com.zmn.oms.model.dto.part.OrderPartDTO;
import com.zmn.oms.model.dto.part.SingleMasterOrderPartDTO;
import com.zmn.oms.model.entity.part.OrderPart;

import java.util.List;

/**
 * 类描述：工单配件
 *
 * @author heciqi
 * @date 2018/11/28 14:48
 */
public interface OrderPartBService {

	/**
	 * 根据工单id查询
	 *
	 * @param orderId
	 * @return
	 */
	OrderPartDTO listByOrderId(Long orderId);

	/**
	 * 根据工单id，工程师id查询
	 *
	 * @param orderId
	 * @param masterId
	 * @return
	 */
	SingleMasterOrderPartDTO listByOrderIdAndMaster(Long orderId, Integer masterId);

	/**
	 * 新增内采配件
	 * @param addOrderPartDTO
	 */
	void insertInOrderPart(AddOrderPartDTO addOrderPartDTO) throws OmsBaseException;

	/**
	 * 新增外报配件
	 * @param addOrderPartDTO
	 */
	void insertOutOrderPart(AddOrderPartDTO addOrderPartDTO) throws OmsBaseException;

	/**
	 * 新增订单杂项费用
	 * @param addOrderPartDTO
	 */
	void insertDeliverOrderPart(AddOrderPartDTO addOrderPartDTO) throws OmsBaseException;

	/**
	 * 新增厂商配件费
	 * @param addOrderPartDTO
	 */
	void insertFactoryOrderPart(AddOrderPartDTO addOrderPartDTO);

	/**
	 * 清空所有工单配件
	 * @param orderId
	 */
	void clearOrderPart(Long orderId, Long operatorId, String operator) throws OmsBaseException;

	/**
	 * 清空OMS配件
	 * @param orderId
	 */
	void clearOmsOrderPart(Long orderId);

	/**
	 * 取消配件报销（外报、运杂）
	 * @param orderId
	 * @param reimburseId
	 * @return void
	 * @author wangxiaokun
	 */
	void clearOrderPartByOrderIdAndReimburseId(Long orderId, String reimburseId);

	/**
	 * 清空工单配件
	 * @param orderId
	 */
	void clearOrderInSourcingPart(Long orderId, Long operatorId, String operator);

	/**
	 * 清空工程师内采配件
	 * @param orderId
	 * @param masterIdList
	 */
	void clearInOrderPartByMasterIds(Long orderId, List<Integer> masterIdList, Long operatorId, String operator) throws OmsBaseException;

	/**
	 * 通过订单Id查询配件报销列表
	 * @param orderId
	 * @return
	 */
    List<OrderPart> listPartReimburseByOrderId(Long orderId);

	/**
	 * 校验工单配件指标
	 *
	 * @param dto
	 */
	void checkOrderGoodsIndicators(CheckOrderPartIndicatorsDTO dto) throws OmsBaseException;
}
